<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'formacao.label', default: 'Formacao')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="cabelistlateral"><img src="${resource(dir:'images',file:'seta_cabecalho_20x20.png')}" /> Cadastro de Formações</div><br/>
        <inc:include url="/includes/inc_estagiario_menu.gsp" />
        <div class="body">
            <form method="post" action="${createLink(controller:'formacao', action:'save')}">
                <div class="dialog dadospessoais">
                    <g:if test="${flash.message}">
                        <div class="message">${flash.message}</div>
                    </g:if>
                    <g:hasErrors bean="${formacaoInstance}">
                        <div class="errors erro">
                            <g:renderErrors bean="${formacaoInstance}" as="list" />
                        </div>
                    </g:hasErrors>
                    <table>
                        <tbody>
                            <input type="hidden" name="estagiario.id" value="${session.pessoa.id}" />
                            <input type="hidden" name="id" value="0" />
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="ie"><g:message code="formacao.ie.label" default="Instituição de Ensino" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'instituicaoEnsino', 'errors')}">
                                    <g:select name="instituicaoEnsino.id" from="${InstituicaoEnsino.list()}" optionKey="id" value="${formacaoInstance?.instituicaoEnsino?.id}" optionValue="nome" noSelection="['':'Selecione']"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="curso"><g:message code="formacao.curso.label" default="Curso" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'curso', 'errors')}">
                                    <g:select name="curso.id" from="${Curso.list()}" optionKey="id" value="${formacaoInstance?.curso?.id}" optionValue="descricao" noSelection="['':'Selecione']"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="andamento"><g:message code="formacao.andamento.label" default="Andamento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'andamento', 'errors')}">
                                    <g:textField name="andamento" size="40" value="${fieldValue(bean: formacaoInstance, field: 'andamento')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="anoFim"><g:message code="formacao.anoFim.label" default="Ano Final" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'anoFim', 'errors')}">
                                    <g:textField name="anoFim" value="${fieldValue(bean: formacaoInstance, field: 'anoFim')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="anoIni"><g:message code="formacao.anoIni.label" default="Ano de Inicio" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'anoIni', 'errors')}">
                                    <g:textField name="anoIni" value="${fieldValue(bean: formacaoInstance, field: 'anoIni')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="atividade"><g:message code="formacao.atividade.label" default="Área de Atividade" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'atividade', 'errors')}">
                                    <g:select name="atividade.id" from="${Atividade.list()}" optionKey="id" value="${formacaoInstance?.atividade?.id}" optionValue="descricao" noSelection="['':'Selecione']"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nivelEnsino"><g:message code="formacao.nivelEnsino.label" default="Nível de Ensino" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: formacaoInstance, field: 'nivelEnsino', 'errors')}">
                                    <g:select name="nivelEnsino.id" from="${NivelEnsino.list()}" optionKey="id" value="${formacaoInstance?.nivelEnsino?.id}" optionValue="descricao"  noSelection="['':'Selecione']"/>
                                </td>
                            </tr>
                            <tr>
                              <td></td>
                              <td class="btsalvarcadastro">
                                  <g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
                              </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <div class="dadoslateral">
                  <g:include  view="formacao/inc_list.gsp" />
                </div>
                
            </form>
        </div>
    </body>
</html>
